﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Pipeline;
using Microsoft.SqlServer.Dts.Runtime;

namespace SSISForSAPComponents
{
    public class SAPPipelineComponent : PipelineComponent
    {
        protected SAPConnectionManager conn;
        /// <summary>
        /// 得到连接
        /// </summary>
        /// <param name="transaction"></param>
        public override void AcquireConnections(object transaction)
        {
            if (base.ComponentMetaData.RuntimeConnectionCollection[0].ConnectionManager != null)
            {
                ConnectionManager manager = DtsConvert.ToConnectionManager(base.ComponentMetaData.RuntimeConnectionCollection[0].ConnectionManager);
                conn = (SAPConnectionManager)manager.AcquireConnection(""); 
            }
           
        }
        public override void ReleaseConnections()
        {
            this.conn = null;
        }
    }
}
